/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ultrasoft.farmasoft.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Administrador
 */
@Embeddable
public class AttributePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "attributeId")
    private int attributeId;
    @Basic(optional = false)
    @Column(name = "activeSubstanceId")
    private int activeSubstanceId;

    public AttributePK() {
    }

    public AttributePK(int attributeId, int activeSubstanceId) {
        this.attributeId = attributeId;
        this.activeSubstanceId = activeSubstanceId;
    }

    public int getAttributeId() {
        return attributeId;
    }

    public void setAttributeId(int attributeId) {
        this.attributeId = attributeId;
    }

    public int getActiveSubstanceId() {
        return activeSubstanceId;
    }

    public void setActiveSubstanceId(int activeSubstanceId) {
        this.activeSubstanceId = activeSubstanceId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) attributeId;
        hash += (int) activeSubstanceId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AttributePK)) {
            return false;
        }
        AttributePK other = (AttributePK) object;
        if (this.attributeId != other.attributeId) {
            return false;
        }
        if (this.activeSubstanceId != other.activeSubstanceId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ultrasoft.farmasoft.domain.AttributePK[ attributeId=" + attributeId + ", activeSubstanceId=" + activeSubstanceId + " ]";
    }
    
}
